package com.ybwh.springboot2;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.transaction.annotation.EnableTransactionManagement;


/**
 * SpringBootApplication上使用@ServletComponentScan注解后，
 * Servlet、Filter、Listener可以直接通过@WebServlet、@WebFilter、@WebListener注解自动注册，无需其他代码。
 * <p>
 * EnableAspectJAutoProxy :Aop可以将代理对象暴露到当前线程局部变量中;
 *
 * @author ybwh
 */
@Slf4j
@SpringBootApplication(
        exclude = {
                //activiti-spring-boot-starter-basic中的配置类，里面依赖了spring-security，不排除这个启动会报错
                org.activiti.spring.boot.SecurityAutoConfiguration.class})
@EnableTransactionManagement
@EnableAspectJAutoProxy(proxyTargetClass = true)
public class SpringbootActiviti {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(SpringbootActiviti.class, args);


        log.error("----------------error-----------------");
        log.warn("----------------warn-----------------");
        log.info("----------------info-----------------");
        log.debug("----------------debug-----------------");
        log.trace("----------------trace-----------------");
        System.out.println();

        String configPath = context.getEnvironment().getProperty("spring.config.location");
        String tomcatPort = context.getEnvironment().getProperty("server.port");
        System.out.println(configPath + "," + tomcatPort);

    }
}
